package Class抽象类接口;
//匿名内部类
interface InterfaceA {
    void func();
}

class TestA implements InterfaceA {
    @Override
    public void func() {
        System.out.println("TestA里面的func~");
    }
}
public class Test_3 {
    public static void main(String[] args) {
        TestA testA = new TestA();
        testA.func();
        System.out.println("____________");
        InterfaceA A = new InterfaceA() {
            @Override
            public void func() {
                System.out.println("匿名内部类里的func~");
            }
        };
        A.func();
        System.out.println("____________");
        new InterfaceA(){
            @Override
            public void func() {
                System.out.println("匿名内部类里的func~");
            }
        }.func();
        System.out.println("____________");
        new TestA(){
            public void func() {
                System.out.println("TestA匿名内部类里的func~");
            }
        }.func();
    }
}
